define(["dojo/_base/declare","dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/text!./profileWidget/templates/profileWidget.html",        
        "dojo", "dojo/_base/xhr", "dojo/on", "dojo/dom", "dojo/dom-class", "dojo/parser",
		"dojo/query", "dojo/dom-attr", "dojo/dom-style", "dojo/dom-construct", "dojo/keys",
		"dojox/widget/Standby", "dojo/fx/Toggler", "dojo/fx", "dojox/fx/text", "dojox/html", "dojox/validate", "dojo/_base/connect", 
		"dijit/registry", "dojo/_base/array", "dojo/_base/lang", "dojo/hash",
		"dojox/html/_base"],
    function(declare, WidgetBase, TemplatedMixin, template, dojo, xhr, on, dom, domClass, parser, query, domAttr, domStyle, construct, keys,
			Standby, Toggler, fx, text, html, validate, connect, registry, array, lang, hash){		

        return declare("dojoCustom.profileWidget", [WidgetBase, TemplatedMixin], {
            firstName: "No Name",    
            lastName: "",
            headLine: "",
            pictureUrl: "",
            userKey: "",
            location: new Object(),
            templateString: template,
            baseClass: "profileWidget",
        	postCreate: function(){
        	    var domNode = this.domNode;
        	    this.inherited(arguments);
        	    this.connect(this.nameLink, "onclick", "extProfileView"); 
        	    this.connect(this.sendMessageLink, "onclick", "widgetSendMessageLink");
        	    this.connect(this.viewProfileLink, "onclick", "extProfileView");
        	},
        	extProfileView : function(e){
				var id = domAttr.get(this.nameLink, "email-attr");
				hash("viewprofile/" + this.userKey);				
			},
			widgetSendMessageLink : function(e){
				var id = domAttr.get(this.sendMessageLink, "email-attr");
				hash("sendmessage/" + this.userKey);
			}
        });
});



